use serde::{Deserialize, Serialize};
use sqlx::prelude::Type;
use utoipa::ToSchema;
use validator::Validate;

pub mod model;
pub mod dto;

#[derive(Debug, Deserialize, Serialize, ToSchema, Type)]
#[sqlx(type_name = "gender_enum", rename_all = "lowercase")]
pub enum Gender {
    男,
    女,
    未知
}

impl Validate for Gender {
    fn validate(&self) -> Result<(), validator::ValidationErrors> {
        // 枚举值本身已经有限制，无需额外验证
        Ok(())
    }
}